import { each } from 'lodash';

const toggleBtn = (vueComponent, refName) => {
  const btns = vueComponent.$refs[refName].children;
  each(btns, item => {
    item.classList.remove("active");
  });
  if (vueComponent.isLoginForm) {
    btns[0].classList.add("active");
  } else {
    btns[1].classList.add("active");
  }
};

export default toggleBtn;